<!doctype html>
<html>
<head>
<script src="../../../resources/testharness.js"></script>
<script src="../../../resources/testharnessreport.js"></script>
<p>This tests caret movement across buttons.
The caret should be just after the second button.</p>
<div id="sample" contenteditable>
<input type="submit" value="Foo"><input type="reset" value="Bar">
</div>
<div id="log"></div>
<script>
test(function() {
    var selection  = window.getSelection();
    var sample = document.getElementById("sample");
    selection.collapse(sample, 0);
    selection.modify('move', 'forward', 'character');
    selection.modify('move', 'forward', 'character');

    assert_equals(selection.anchorNode, sample, 'anchorNode');
    assert_equals(selection.anchorOffset, 3, 'anchorOffset');
    assert_equals(selection.focusNode, sample, 'focusNode');
    assert_equals(selection.focusOffset, 3, 'focusOffset');
});
</script>
